package org.space.ai.feign;

import com.galaxy.common.mybatis.core.page.TableDataInfo;
import org.space.ai.config.FeignConfig;
import org.space.ai.domain.ProductBo;
import org.space.ai.domain.ProductVo;
import org.space.ai.feign.fallback.ProductFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
    contextId = "productFeignClient",
    value = "galaxy-product",
    fallbackFactory = ProductFeignFallbackFactory.class,
    configuration = FeignConfig.class
)
public interface ProductFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/product/list", consumes = "application/json")
    TableDataInfo<ProductVo> listProducts(@RequestParam(required = false) ProductBo bo,
                                          @RequestParam(required = false) Integer pageNum,
                                          @RequestParam(required = false) Integer pageSize);
}
